import React from 'react';

import { Route, Link, useParams } from 'react-router-dom';

const Child = () => {
    let { id } = useParams();
    return (
        <div>
            {id}
        </div>
    );
};

class UrlParams extends React.Component {
    render () {
        return (
            <div>
                <Link to="/aaa">aaa</Link> |
                <Link to="/bbb">bbb</Link> |
                <Link to="/ccc">ccc</Link>
                <Route path="/:id" component={Child}></Route>
            </div>
        );
    }
}

export default UrlParams;
